package com.alex.j2se.Date;

import org.junit.Test;

import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

/**
 * Author  : gaojun            <br/>
 * Date    : 2020/7/3                          <br/>
 * Time    : 2:05 下午                         <br/>
 * ---------------------------------------    <br/>
 * Desc    :
 */
public class LocalDateTest {
    @Test
    public void currentDayDateTest() {
        ZoneId zoneId = ZoneId.systemDefault();
        LocalDate localDate = LocalDate.now();
        ZonedDateTime zdt = localDate.atStartOfDay(zoneId);

        Date date = Date.from(zdt.toInstant());

        System.out.println("LocalDate = " + localDate);
        System.out.println("Date = " + date);
    }
}
